package com.prosoft.hib.example1;

import java.util.Date;

import org.hibernate.Session;

import com.prosoft.user.DBUser;
import com.prosoft.util.HibernateUtil;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
    	System.out.println("Maven + Hibernate + Oracle");
    	Session session = HibernateUtil.getSessionFactory().openSession();
		try{
		session.beginTransaction();
		
		DBUser user = new DBUser();
		 
		user.setUserId(1);
		user.setUsername("test1");
		user.setCreatedBy("system");
		user.setCreatedDate(new Date());
		
		session.save(user);
		session.getTransaction().commit();
		
		}catch(Exception e){
			e.printStackTrace();
		}
    }
}
